//
//  XQViewController.swift
//  XiaoQiQiaoSwift
//
//  Created by tech-lab on 2016/11/23.
//  Copyright © 2016年 校企桥. All rights reserved.
//

import UIKit


class XQTabBarViewController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        InitMainViewController()
        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    func InitMainViewController() {
        
        
        self.tabBar.isTranslucent = false
    
        
        UINavigationBar.appearance().barTintColor = UIColor.white
        
//        let attributes = [NSForegroundColorAttributeName:UIColor.green]
//        UIBarButtonItem.appearance().setTitleTextAttributes(attributes, for: .normal)
//        self.tabBarItem.setTitleTextAttributes(attributes, for: .normal)
        
        self.tabBar.tintColor = UIColor.green
   
        let homeVC = XQHomeViewController()
        homeVC.tabBarItem = UITabBarItem.init(title: "首页", image: UIImage(named: "首页2"),selectedImage:UIImage(named:"首页1"))
        let homeNav = UINavigationController.init(rootViewController: homeVC)
        
        let courseVC = XQCourseViewController()
        courseVC.tabBarItem = UITabBarItem.init(title: "课程", image: UIImage.init(named: "课程2"), selectedImage: UIImage.init(named: "课程1"))
        let courseNav = UINavigationController.init(rootViewController: courseVC)
        
        
        let positionVC = XQPositionViewController()
        positionVC.tabBarItem = UITabBarItem.init(title: "职位", image: UIImage.init(named: "职位2"), selectedImage: UIImage.init(named: "职位1"))
        let positionNav = UINavigationController.init(rootViewController: positionVC)
        
        let findVC = XQFindViewController()
        findVC.tabBarItem = UITabBarItem.init(title: "发现", image: UIImage.init(named: "发现2"), selectedImage: UIImage.init(named: "发现1"))
        let findNav = UINavigationController.init(rootViewController: findVC)
        
        let personalVC = XQPersonalViewController()
        personalVC.tabBarItem = UITabBarItem.init(title: "个人", image: UIImage.init(named: "个人2"), selectedImage: UIImage.init(named: "个人1"))
        let personalNav = UINavigationController.init(rootViewController: personalVC)
        
        let array = NSArray.init(array: [homeNav,courseNav,positionNav,findNav,personalNav]);
        self.viewControllers = array as? [UIViewController]
        
        
        
    }
    
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
